package com.uw.gateway.config;

import com.uw.uwrpc.core.annotation.EnableUWReference;
import com.uw.uwrpc.core.api.LoadBalancer;
import com.uw.uwrpc.core.api.RegistryCenter;
import com.uw.uwrpc.core.cluster.loadbalancer.RoundRobinLoadBalancer;
import com.uw.uwrpc.core.config.UWRegistryProperty;
import com.uw.uwrpc.core.meta.InstanceMeta;
import com.uw.uwrpc.core.registry.impl.UWRegistryCenter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableUWReference
public class UwRpcConfig {


    //@Bean
    public RegistryCenter registryCenter(UWRegistryProperty uwRegistryProperty) {
        return new UWRegistryCenter(uwRegistryProperty);
    }

    //@Bean
    public LoadBalancer<InstanceMeta> loadBalancer() {
        return new RoundRobinLoadBalancer();
    }


}
